#include "Graph.h"
#include "Stripped_circle.h"
#include <cmath>

namespace Graph_lib{

void Stripped_circle::draw_lines() const{
    if (color().visibility()){
        fl_color(color().as_int());    // reset color
        Point c=center();

        int y1=c.y-radius();
        int y2=c.y+radius();

        for (int yy=y1;yy<=y2;yy+=2){
            int dx=sqrt(radius()*radius()-(yy-c.y)*(yy-c.y));
            fl_line(c.x-dx, yy,c.x+dx,yy);
        }
    }
}
}
